package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.io.handler.h;
import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.EsriServiceException;
import com.esri.core.io.UserCredentials;

/* loaded from: classes.dex */
class GPExecuteTask extends GPTask<GPParameter[]> {
    private static final long serialVersionUID = 1;

    public GPExecuteTask(GPTaskParameters gPTaskParameters, String str, UserCredentials userCredentials) {
        super(gPTaskParameters, str, userCredentials);
    }

    public GPExecuteTask(GPTaskParameters gPTaskParameters, String str, UserCredentials userCredentials, TaskListener<GPParameter[]> taskListener) {
        super(gPTaskParameters, str, userCredentials, taskListener);
        if (gPTaskParameters == null) {
            throw new EsriServiceException("The geoprocess execute task requires input parameters");
        }
    }

    @Override // com.esri.core.internal.tasks.a
    public GPParameter[] execute() throws Exception {
        GPResultResource executeInternal = executeInternal();
        this._messages = executeInternal.getMessages();
        return executeInternal.getOutputParameters();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GPResultResource executeInternal() throws Exception {
        return GPResultResource.fromJson(h.a(getServiceURL() + "/execute", ((GPTaskParameters) getActionInput()).generateRequestParams(), getServiceCredentials()));
    }
}
